package org.speed.spring.core;

import java.lang.reflect.Method;

import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

public class Worker implements MethodBeforeAdvice {

	private String name;
	
	private String age;
	
	//@Value("${username}")
	private String username;
	
	//@Autowired
	private Company company;
	

	public Worker(String name, String age) {
		this.name = name;
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}

	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}
	
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Override
	public String toString() {
		return "Worker [name=" + name + ", age=" + age + ", username=" + username + ", company=" + company + "]";
	}

	public void test() {
		System.out.println("test");
	}
	@Override
	public void before(Method method, Object[] args, Object target) throws Throwable {
		System.out.println("before");
	}
	
	
	
}
